package com.hs.auth.dwr;

import java.util.List;
import java.util.Map;

import com.hs.core.dwr.DwrHelper;

public class AuthDwr   extends DwrHelper{
	/**
	 * 删除帐号
	 * @param accid
	 */
	public void deleteUser(String accid){
		this.getDbo().update("delete from  HS_ACCOUNT   WHERE ID=?", new Object[]{accid});
	}
	/**
	 * 检查是否有重复帐号
	 * @param loginId
	 * @return
	 */
	public String isDouble(String loginId){
		List accList = this.getDbo().queryList("select to_char(count(*)) as countnum from HS_ACCOUNT where LOGINID=?", new Object[]{loginId});
		Map data = (Map)accList.get(0);
		return (String)data.get("countnum");
	}
	
	
	
	/**
	 * 删除帐号
	 * @param accid
	 */
	public void deleteOrg(String orgid){
		System.out.println("****************************"+orgid);
		this.getDbo().update("update hs_org set ISUSE=0 WHERE ID=?", new Object[]{orgid});
	}
	
	/**
	 * 检查是否有重复帐号
	 * @param loginId
	 * @return
	 */
	public String isOrgDouble(String orgName){
		List accList = this.getDbo().queryList("select to_char(count(*)) as countnum from hs_org  where ORGNAME=?", new Object[]{orgName});
		Map data = (Map)accList.get(0);
		return (String)data.get("countnum");
	}

}
